/*
 * @Author: wangmyng wangmyng@163.com
 * @Date: 2025-11-04 21:56:45
 * @LastEditors: wangmyng wangmyng@163.com
 * @LastEditTime: 2025-11-09 23:17:35
 */
// SegmentNumber.tsx
import React from 'react';
import SegmentDigit from './SegmentDigit';
import "./index.less";

interface SegmentNumberProps {
  value: number;
  color?: string; // 数字颜色
}
/**
 * 电子样式数字组件
 */
const SegmentNumber: React.FC<SegmentNumberProps> = ({ 
  value, 
  color='#fff'
}) => {

  const digitArray = value.toString().split('');

  return (
    <div className={'segmentNumber'}>
      {digitArray.map((digit, index) => (
        <SegmentDigit 
          key={index}
          value={parseInt(digit)}
          color={color}
          size={0.8}
        />
      ))}
    </div>
  );
};
export default SegmentNumber;